package com.jiliang.auth.dao.mapper;

import com.jiliang.auth.dao.model.AuthFunc;
import com.jiliang.auth.domain.AuthFuncBo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import java.util.List;


@Mapper
public interface AuthFuncExMapper {


    @Insert("insert into auth_func(type, name, code,\n" +
            "      url, icon, mob_url,\n" +
            "      mob_icon, sort, rank,\n" +
            "      axis, parent_func_id, is_end,\n" +
            "      user_type_match, manage_type, is_back,\n" +
            "      sub_system_id, system_id, data_remark,\n" +
            "      create_time, version_remark, vno,\n" +
            "      is_enabled) values (#{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},\n" +
            "      #{url,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{mobUrl,jdbcType=VARCHAR},\n" +
            "      #{mobIcon,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{rank,jdbcType=INTEGER},\n" +
            "      #{axis,jdbcType=VARCHAR}, #{parentFuncId,jdbcType=BIGINT}, #{isEnd,jdbcType=SMALLINT},\n" +
            "      #{userTypeMatch,jdbcType=VARCHAR}, #{manageType,jdbcType=VARCHAR}, #{isBack,jdbcType=SMALLINT},\n" +
            "      #{subSystemId,jdbcType=SMALLINT}, #{systemId,jdbcType=SMALLINT}, #{dataRemark,jdbcType=VARCHAR},\n" +
            "      #{createTime,jdbcType=TIMESTAMP}, #{versionRemark,jdbcType=VARCHAR}, #{vno,jdbcType=TIMESTAMP},\n" +
            "      #{isEnabled,jdbcType=SMALLINT})" )
    @Options(useGeneratedKeys=true,keyProperty = "id", keyColumn = "id")
    int insertAuthFunc(AuthFunc record);

    List<AuthFunc> selectAuthAll(AuthFuncBo authFuncBo);
}
